package com.lindroy.androidplayer.ui.adapter

import androidx.fragment.app.Fragment
import com.lindroy.androidplayer.R
import com.lindroy.androidplayer.base.adapter.BaseTabAdapter
import com.lindroy.androidplayer.ui.collection.CollectionArticlesFragment
import com.lindroy.androidplayer.ui.collection.CollectionWebsitesFragment
import com.lindroy.lib_utils.extensions.getResString

/**
 * @author Lin
 * @date 2022/2/18
 * @function
 */
class CollectionTabAdapter(fragment: Fragment) : BaseTabAdapter<String>(fragment) {
    override fun createItemFragment(item: String): Fragment = when (item) {
        getResString(R.string.collection_article) -> CollectionArticlesFragment()
        getResString(R.string.collection_website) -> CollectionWebsitesFragment()
        else -> CollectionArticlesFragment()
    }
}